<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://code.google.com/p/jmesa" prefix="jmesa" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>

<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.6.2.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jmesa.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.jmesa.js"></script>

<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/css/jmesa.css" />
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/css/styles.css"/>
<form:form action="${pageContext.request.contextPath}/zapato/paginate.htm">
	<table class="tablelist">
		<tr><td class="tdtitle">
			<spring:message code="zapato.title.list"/>
		</td></tr>
		<tr><td>
			<jmesa:tableModel id="tableModel" items="${zapatoList}" var="bean">
		        <jmesa:htmlTable>
		            <jmesa:htmlRow>
		            	<jmesa:htmlColumn property="id" titleKey="zapato.id" sortable="false" filterable="false"/>
		            	<jmesa:htmlColumn property="talle" titleKey="zapato.talle" sortable="false" filterable="false"/>
		            	<jmesa:htmlColumn property="color" titleKey="zapato.color" sortable="false" filterable="false"/>
		            	<jmesa:htmlColumn property="marca" titleKey="zapato.marca" sortable="false" filterable="false"/>
		            	<jmesa:htmlColumn property="zapato.action.detail" titleKey="zapato.action.detail" sortable="false" filterable="false">
		            		<a href="#" onclick="zapatoDetail('${bean.id}');"><spring:message code="zapato.action.detail"/></a>
		            	</jmesa:htmlColumn>
		            	<jmesa:htmlColumn property="zapato.action.modify" titleKey="zapato.action.modify" sortable="false" filterable="false">
		            		<a href="#" onclick="modifyZapato('${bean.id}');"><spring:message code="zapato.action.modify"/></a>
		            	</jmesa:htmlColumn>
		            	<jmesa:htmlColumn property="zapato.action.delete" titleKey="zapato.action.delete" sortable="false" filterable="false">
		            		<a href="#" onclick="deleteZapato('${bean.id}');"><spring:message code="zapato.action.delete"/></a>
		            	</jmesa:htmlColumn>
		            </jmesa:htmlRow>
				</jmesa:htmlTable>
			</jmesa:tableModel>
		</td></tr>
    </table>
</form:form>

<form:form id="zapatoIdForm" commandName="searchZapatoId">
	<input type="hidden" id="id" name="id" />
</form:form>

<table style="margin-left:auto;margin-right:auto">
	<tr>
		<td>
			<a href="${pageContext.request.contextPath}"><img height="50px" src="${pageContext.request.contextPath}/images/home.gif" alt="Home"></a>
		</td>
	</tr>		
</table>

<script type="text/javascript">
	function onInvokeAction(id, action) {
	    setExportToLimit(id, '');
	    createHiddenInputFieldsForLimitAndSubmit(id);
	}
	function zapatoDetail(id){
		setValues(id);
		$('#zapatoIdForm')[0].action="${pageContext.request.contextPath}/zapato/detail.htm";
		$('#zapatoIdForm')[0].submit();
	}
	function modifyZapato(id){
		setValues(id);
		$('#zapatoIdForm')[0].action="${pageContext.request.contextPath}/zapato/modify.htm";
		$('#zapatoIdForm')[0].submit();
	}
	function deleteZapato(id){
		setValues(id);
		$('#zapatoIdForm')[0].action="${pageContext.request.contextPath}/zapato/delete.htm";
		$('#zapatoIdForm')[0].submit();
	}
	function setValues(id){
			$('#id')[0].value=id;
	}
</script>
